Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(vmclass): add events about available nodes and sizing policies changed #606

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

eofff
Copy link
Contributor

@eofff eofff commented Dec 24, 2024

Description

Using new events api.
Add event when list of available nodes changed.
Add event when sizing policies changed.

Why do we need it, and what problem does it solve?

What is the expected result?

Checklist

  • The code is covered by unit tests.
  • e2e tests passed.
  • Documentation updated according to the changes.
  • Changes were tested in the Kubernetes cluster manually.

@eofff eofff requested review from diafour and Isteb4k December 24, 2024 14:32
@eofff eofff force-pushed the feat/vmclass/add-events-about-node-and-policy-changes branch from 40ac6c9 to 7dd0311 Compare December 24, 2024 14:32
@eofff eofff changed the title feat(vmclass): Add events about available nodes and sizing policies changed feat(vmclass): add events about available nodes and sizing policies changed Dec 25, 2024
@eofff eofff force-pushed the feat/vmclass/add-events-about-node-and-policy-changes branch from 7dd0311 to 2599df7 Compare December 25, 2024 14:40
@eofff eofff force-pushed the feat/vmclass/add-events-about-node-and-policy-changes branch 3 times, most recently from 57f3f1a to ea2db1c Compare January 14, 2025 09:52
@eofff eofff requested a review from Isteb4k January 14, 2025 11:05
@eofff eofff force-pushed the feat/vmclass/add-events-about-node-and-policy-changes branch 2 times, most recently from 1afff48 to bdc28ef Compare January 15, 2025 08:51
Comment on lines +81 to +84
cb.
Status(metav1.ConditionFalse).
Reason(vmclasscondition.ReasonVMClassFree).
Message("")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to add a separate condition "VMClassFree", vmclass is in a deletion state at this point, it will be deleted almost immediately after removing finalizers.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@@ -95,4 +92,13 @@ const (

// ReasonDataSourceDiskProvisioningFailed is event reason that DataSource disk provisioning is failed.
ReasonDataSourceDiskProvisioningFailed = "DataSourceImportDiskProvisioningFailed"

// ReasonVMClassSizingPoliciesWasChanged is event reason that VMClass sizing policies was changed.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

were changed

cb.
Status(metav1.ConditionTrue).
Reason(vmclasscondition.ReasonVMClassInUse).
Message(msg)
return reconcile.Result{RequeueAfter: 60 * time.Second}, nil
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not subscribe to virtual machine deletion?

Comment on lines +81 to +84
cb.
Status(metav1.ConditionFalse).
Reason(vmclasscondition.ReasonVMClassFree).
Message("")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

prevMap := make(map[string]struct{})
currentMap := make(map[string]struct{})

for _, n := range prev {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

n usually means a number, but I suppose not in this context.

removed []string
}

var _ = Describe("DiscoveryHandler Run", func() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DiscoveryHandler doesn't have method Run

@eofff eofff force-pushed the feat/vmclass/add-events-about-node-and-policy-changes branch 2 times, most recently from 567b93f to e02321c Compare January 23, 2025 15:08
Valeriy Khorunzhin added 5 commits January 23, 2025 18:08
Signed-off-by: Valeriy Khorunzhin <[email protected]>
Signed-off-by: Valeriy Khorunzhin <[email protected]>
Signed-off-by: Valeriy Khorunzhin <[email protected]>
Signed-off-by: Valeriy Khorunzhin <[email protected]>
Signed-off-by: Valeriy Khorunzhin <[email protected]>
@eofff eofff force-pushed the feat/vmclass/add-events-about-node-and-policy-changes branch from e02321c to ff7a5aa Compare January 23, 2025 15:08
Valeriy Khorunzhin added 2 commits January 23, 2025 19:07
fix
Signed-off-by: Valeriy Khorunzhin <[email protected]>
Signed-off-by: Valeriy Khorunzhin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants